package com.powernode.work.controller;

import com.powernode.commons.utils.ResponseData;
import com.powernode.work.service.CustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("customer")
@Api(tags = "客户信息")
public class CustomerController {
    @Autowired
    private CustomerService service;

    @GetMapping
    @ApiOperation("分页显示所有的客户")
    public ResponseData page(@RequestParam(required = false,defaultValue = "1") Integer pageNum,
                            @RequestParam(required = false,defaultValue = "5") Integer pageSize){
        return service.page(pageNum,pageSize);
    }
}
